<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>首页 - 驴妈妈流立方</title>
		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		<script src="${rc.contextPath}/assets/js/jquery.2.1.1.min.js"></script>
		<script src="${rc.contextPath}/assets/js/bootstrap.min.js"></script>
		<script src="${rc.contextPath}/assets/js/jquery-ui.custom.min.js"></script>
		<script src="${rc.contextPath}/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="${rc.contextPath}/assets/js/bootbox.min.js"></script>
		<script src="${rc.contextPath}/assets/js/jquery.gritter.min.js"></script>
		<script src="${rc.contextPath}/assets/js/spin.min.js"></script>
		<!-- ace scripts -->
		<script src="${rc.contextPath}/assets/js/ace-elements.min.js"></script>
		<script src="${rc.contextPath}/assets/js/ace.min.js"></script>
		<!-- validator scripts -->
		<script src="${rc.contextPath}/assets/js/bootstrapValidator.min.js"></script>
		<!-- user scripts -->
		<script src="${rc.contextPath}/assets/js/user/base.js"></script>
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/font-awesome/4.2.0/css/font-awesome.min.css" />
		<!-- page specific plugin styles -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/jquery-ui.custom.min.css" />
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/jquery.gritter.min.css" />
		<!-- text fonts -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/fonts/fonts.googleapis.com.css" />
		<!-- BootstrapValidator -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrapValidator.min.css" />
		<!-- ace styles -->
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
		<!-- ace settings handler -->
		<script src="${rc.contextPath}/assets/js/ace-extra.min.js"></script>
		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bsie-paginator.css" />
		<style type="text/css">
			th{
				text-align:center !important;
			}
			table{
				text-align:center;
				margin-bottom: 0px;
				border-bottom: 0px;
			}
		</style>
	</head>

	<body class="no-skin" style="background-color: #FFF;">
		<div class="col-xs-6 col-xs-offset-3">
			<div class="widget-header widget-header-small" style="text-align:center;">
				<h2>电话跟单数据下载(过去30天)</h2>
			</div>
			<div>
			<form class="form-inline" id="searchForm" method="post" action="${rc.contextPath}/returnVisit/directoryShows">
			</form>
			<form action="${rc.contextPath}/returnVisit/actionDownload" id="exportForm" method="post" hidden="true">
				<input id="loginName" name="loginName" type="text" hidden="true" value="${currentUser.loginName}">
				<input id="directory" name="directory" type="text" hidden="true">
				<button type="submit" hidden="true" id="download" class="btn btn-primary" ></button>
			</form>
			<div class="row">
				<div>
					<div class="widget-box">
						<div class="row">
							<div class="col-xs-12">
								<div style="width: 100%; margin: 0 auto;">
									<table class="table table-striped table-bordered table-hover">
										<thead>
											<tr>
												<th>序号</th>
												<th>日期</th>
												<th>操作</th>
											</tr>
										</thead>
										<tbody>
											<#if date1?? && date1?size&gt;0>
												<#list date1 as date>
													<tr class="">
														<td>${date_index + 1}</td>
														<td>${date}</td>
														<td><a class = "blue" href = "javascript:void(0);" onclick="actionDownload('${date}');">
															<i class = "ace-icon fa fa-download bigger-130"></i></a></td>
													</tr>
												</#list>
											<#else>
												<tr>
													<td colspan="12">
														<div class="alert alert-danger" style="margin-bottom: 0px;" role="alert">没有记录!</div>
													</td>
												</tr>
											</#if>
										</tbody>
									</table>
									<#include "paginator.html">
								</div>
							</div>
						</div>
					</div>
				</div>
				
			</div>
			
		</div>

		<script src="${rc.contextPath}/assets/js/moment.min.js"></script>
		<script src="${rc.contextPath}/assets/js/bootstrap-datetimepicker.min.js"></script>
		
		<!-- <link rel="stylesheet" href="${rc.contextPath}/stylesheets/bootstrap.min.css"> -->
		<!-- <link rel="stylesheet" href="${rc.contextPath}/stylesheets/bootstrap-theme.min.css"> -->
		<link rel="stylesheet" href="${rc.contextPath}/stylesheets/daterangepicker.css">
		<script type="text/javascript" src="${rc.contextPath}/javascripts/jquery.2.1.1.min.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/bootstrap.min.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/moment.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/daterangepicker.js"></script>
	   	
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/echarts.js"></script>
	   	<script type="text/javascript" src="${rc.contextPath}/javascripts/china.js"></script>
	   	<script src="${rc.contextPath}/assets/js/jquery.gritter.min.js"></script>
		<script type="text/javascript">
			function actionDownload(directory){
				$.ajax({
					url : "${rc.contextPath}/returnVisit/inspectionDirectory",
					type:'post',
					data : {
						"directory" : directory,
					},
					dataType : "json",
					success : function(data) {
						if(data!=null){
							if(data.message == '1'){
								//window.location.href = "${rc.contextPath}/returnVisit/actionDownload?directory=" + directory;
								$("#directory").val(directory);
								$("#download").click();
							}else{
								showMsg(data.message);
							}
						}
					}
				}); 
			}
			
			jQuery(function($) {
				
			})
			
			
		</script>


		<link rel="stylesheet" href="${rc.contextPath}/assets/css/bootstrap.css" /> 
		<script src="${rc.contextPath}/assets/js/chosen.jquery.js"></script>
		
		<script>
			 $(function() {
		        $('.chosen-select').chosen();
		       	$('.chosen-select-deselect').chosen({ allow_single_deselect: true });
		     }); 
	      	
			 function statistics(){
				$('#statistics').show();
				$('.chosen-select').chosen("destroy").chosen();
		       	$('.chosen-select-deselect').chosen({ allow_single_deselect: true });
			 }
	    </script>
	    
	</body>
</html>